package me.feng.dao.impl

import me.feng.domain.Member
import org.hibernate.Session
import org.hibernate.Query

class MemberDao (session:Session) extends BaseDao(session){
  
  def getMemberbyUsername(username:String):Member={
    println("Dao getMemberbyUsername")
    val sql = "from me.feng.domain.Member t where t.username=?"
    val q = session.createQuery(sql).setParameter(0, username)
    getFirst(q).asInstanceOf[Member]
  }
  
  def getMemberbyUid(uid:String):Member = {
    println("Dao getMemberbyUid")
    session.get(classOf[Member],uid).asInstanceOf[Member]
  }
  
  
}